<template>
  <div class="ProgressChart-wrap" ref="progressChartRef"></div>
</template>

<script lang="ts">
export default {
  name: "ProgressChart",
};
</script>

<script lang="ts" setup>
import * as echarts from "echarts";
import { ref, onMounted } from "vue";
const progressChartRef = ref();
onMounted(() => {
  const myEcharts = echarts.init(progressChartRef.value);
  const option = {
    xAxis: {
      min: 0,
      max: 100,
      show: false,
    },
    yAxis: {
      data: ["一月"],
      show: false,
    },
    series: {
      type: "bar",
      data: [78],
      //   条柱样式
      itemStyle: {
        color: "#73bd6e",
      },
      barWidth: 10, //条形宽度

      showBackground: true, //显示背景色
      label: {
        show: true,
        formatter: "|",
        position: "right",
        color: "#73bd6e",
      },
    },
    grid: {
      left: 0,
      right: 0,
      top: 0,
      bottom: 0,
    },
  };

  myEcharts.setOption(option);
});
</script>

<style scoped>
.ProgressChart-wrap {
  width: 100%;
  height: 100%;
}
</style>